<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../../bower_components/bootstrap/dist/css/bootstrap.min.css"
          th:href="@{/LoginStyle/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../../bower_components/font-awesome/css/font-awesome.min.css"
          th:href="@{/LoginStyle/css/font-awesome.min.css}">
    <!-- Ionicons -->
    <link rel="stylesheet" href="../../bower_components/Ionicons/css/ionicons.min.css"
          th:href="@{/LoginStyle/css/ionicons.min.css}">
    <!-- DataTables -->
    <link rel="stylesheet" href="../../bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css"
          th:href="@{/AdminStyle/css/dataTables.bootstrap.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" href="../../dist/css/AdminLTE.min.css" th:href="@{/AdminStyle/css/AdminLTE.min.css}">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="../../dist/css/skins/_all-skins.min.css"
          th:href="@{/AdminStyle/css/skin-blue.min.css}">
    <style>
        .title {
            width: 300px;
            height: 60px;
            line-height: 60px;
            text-align: center;
            background-color: skyblue;
            font-weight: 700;
            font-size: 18px;
            margin-bottom: 30px;
        }
    </style>
</head>

<body>
<div class="container">
    <div class="row">
        <div class="title">订单确认</div>
        <div><a th:href="@{/User/store}">返回店铺</a></div>
        <div class="col-xs-12">
            <section class="content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="box">
                            <!-- /.box-header -->
                            <div class="box-body">
                                <table id="example" class="table table-bordered ">
                                    <thead>
                                    <tr>
                                        <th>商品名</th>
                                        <th>收货人</th>
                                        <th>电话号码</th>
                                        <th>地址</th>
                                        <th>数量</th>
                                        <th>总价</th>
                                        <th>交易方式</th>
                                        <th>接受订单</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr th:each="order:${orderList}">
                                        <td th:text="${order.goodsName}">是</td>
                                        <td th:text="${order.persion}"></td>
                                        <td th:text="${order.phone}">是</td>
                                        <td th:text="${order.address}">是</td>
                                        <td th:text="${order.count}">是</td>
                                        <td th:text="${order.price}"></td>
                                        <td th:text="${order.mode}"></td>
                                        <td><a th:id="${order.orderId}" class="submit" href="" #>是</a></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.box-body -->
                        </div>
                        <!-- /.box -->
                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </section>
        </div>
    </div>
</div>
</body>
<!-- jQuery 3 -->
<script src="bower_components/jquery/dist/jquery.min.js" th:src="@{/LoginStyle/js/jquery.min.js}"></script>
<!-- Bootstrap 3.3.7 -->
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js" th:src="@{/LoginStyle/js/bootstrap.min.js}"></script>
<!-- DataTables -->
<script src="bower_components/datatables.net/js/jquery.dataTables.min.js"
        th:src="@{/AdminStyle/js/jquery.dataTables.min.js}"></script>
<script src="bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"
        th:src="@{/AdminStyle/js/dataTables.bootstrap.min.js}"></script>
<script>
    $(function () {
        $('#example').DataTable({
            "oLanguage": {
                "sUrl": "/AdminStyle/page_zh_CN.json"
            },
            'paging': true,
            'lengthChange': true,
            'searching': false,
            'ordering': true,
            'info': true,
            'autoWidth': false
        })
    });

    $(document).ready(function () {
        $(".submit").click(function () {
            let id = $(this).attr("id");
            $.post("/User/updateStoreOrder/data", {orderId: id}, function (data) {
                if (data == "yes")
                    alert("确认成功！");
            });
        });
    });
</script>

</html>